package com.hw.paltfrom.controller.comper;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hw.paltfrom.pack.ResponseResult;
import com.hw.paltfrom.rescode.HWSystemCode;
import com.hw.paltfrom.service.comper.OaWechatpicServer;
import com.hw.paltfrom.utils.VerifyUtil;
import com.hw.paltfrom.vo.OaWechatpicVo;


/**
 * 李俊君
 * 2019年11月6日15:06:04
 */
@RestController
@RequestMapping(value = "/HwOaWechatpic")
public class OaWechatpicController {
	@Autowired
	private OaWechatpicServer hwOaWechatpicServer;

	
    // 查询 
	@RequestMapping(value = "/query")
	public Map<String, Object> Query(OaWechatpicVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return hwOaWechatpicServer.queryAllList(vo);

	}

	// 添加
	@RequestMapping(value = "/insert")
	public Map<String, Object> insert(OaWechatpicVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return hwOaWechatpicServer.insert(vo);
	}

	// 更新
	@RequestMapping(value = "/update")
	public Map<String, Object> update(OaWechatpicVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return hwOaWechatpicServer.update(vo);

	}

	// 删除
	@RequestMapping(value = "/delete")
	public Map<String, Object> delete(OaWechatpicVo vo) {
		Boolean flag = VerifyUtil.verifyParams(vo);
		if (!flag) {
			return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
		}
		return hwOaWechatpicServer.delete(vo);

	}
    //查询微信小程序
    @RequestMapping("findTypes")
    public Map<String, Object> findTypes(){
        return hwOaWechatpicServer.findTypes();
    }
}
